/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package platform;

import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
import zorg.ZrtpCacheEntry;
import zorg.platform.PersistentHashtable;

/**
 *
 * @author Tomasz Nowak
 */
public class TenorPersistentHashTable implements PersistentHashtable
{
	Map<String, ZrtpCacheEntry> map;

	public TenorPersistentHashTable()
	{
		map = new HashMap<>();

	}

	@Override
	public void remove( String zid )
	{
		map.remove(zid);
	}

	@Override
	public void put( String zid, byte[] data, String phoneNumber )
	{
		map.put(zid, new TenorZrtpCacheEntry(data, phoneNumber));
	}

	@Override
	public Enumeration keys()
	{
		return new Vector(map.keySet()).elements();
	}

	@Override
	public ZrtpCacheEntry get( String zid )
	{
		return map.get(zid);
	}

	@Override
	public void reset()
	{
		map.clear();
	}
}
